<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:51:"/var/www/fish/application/crm/view/index/index.html";i:1517804175;}*/ ?>
<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>小鱼ADMIN</title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />

    <link rel="stylesheet" href="/public/static/css/font.css">
	<link rel="stylesheet" href="/public/static/css/bgadmin.css">
    <script type="text/javascript" src="/public/static/js/jquery-1.8.0.min.js"></script>
    <script src="/public/static/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/public/static/js/jquery.form.js"></script>  
    <script type="text/javascript" src="/public/static/js/bgadmin.js"></script>
    <script type="text/javascript" src="/public/static/js/callbak.js"></script>
	<script type="text/javascript">
		var CTI_IP = "192.168.88.59:8888"; 
		var exten = "<?php echo $_SESSION['user_info']['extension']; ?>";
	</script>
</head>
<style>
.layui-nav-item{
	margin-right:10px;
}
</style>
<body>
    <!-- 顶部开始 -->
    <div class="container">
        <div class="logo"><a href="./index.html">小鱼-admin v1.0</a></div>
        <div class="left_open">
            <i  title="展开左侧栏" class="iconfont">&#xe699;</i>
        </div>
        <ul class="layui-nav right" lay-filter="">
            <li class="layui-nav-item">
				分机：<span id="id_extension"></span>
			</li>
			<li class="layui-nav-item">
				状态：<span id="id_extenstatus"></span>
			</li>
			<li class="layui-nav-item" style="display:none;" id="servicepauseReason">
				  <button class="layui-btn layui-btn-small layui-btn-danger" onclick="servicepauseReason()">
					<i class="layui-icon">&#xe60f;</i>示忙
				  </button>
			</li>
			<li class="layui-nav-item" style="display:none;" id="putIdle">
				  <button class="layui-btn layui-btn-small" onclick="putIdle()">
					<i class="layui-icon">&#xe606;</i>示闲
				  </button>
			</li>
			<li class="layui-nav-item" style="display:none;" id="quickdial">
				  <button class="layui-btn layui-btn-small layui-btn-warm" onclick="openQuickdial()">
					<i class="layui-icon">&#xe611;</i>拨号
				  </button>
			</li>
			<li class="layui-nav-item" style="display:none;" id="transfer">
				  <button onclick="openTransfer()" class="layui-btn layui-btn-small layui-btn-normal">
					<i class="layui-icon">&#xe631;</i>转接
				  </button>
			</li>
			<li class="layui-nav-item" style="display:none;"  id="threeCall">
				  <button onclick="openThreeCall()" class="layui-btn layui-btn-small layui-btn-normal">
					<i class="layui-icon">&#xe609;</i>三方通话
				  </button>
			</li>
			<!--<li class="layui-nav-item" id="callPauseOrRestore">
				  <button onclick="callPauseOrRestore()" class="layui-btn layui-btn-small">
					<i class="layui-icon">&#xe651;</i><span id="callPauseSpan">保持</span>
				  </button>
				  <input type="hidden" id="id_holdedChannel" value=""/>
			</li>-->
			<li class="layui-nav-item" style="display:none;" id="hangup">
				  <button class="layui-btn layui-btn-small " onclick="hangup()">
					<i class="layui-icon">&#x1006;</i>挂起
				  </button>
			</li>
			<li class="layui-nav-item">
                <a href="javascript:;"><img src="/public/static/images/icon.jpg" class="layui-nav-img"><?php echo $_SESSION['user_info']['cn_name']; ?></a>
                <!-- <dl class="layui-nav-child"> 
                  <dd><a style="cursor: pointer;" onclick="bg_admin_show('个人信息','/index.php/crm/Index/personalInfo.html',350,520)">个人信息</a></dd>
                  <dd><a style="cursor: pointer;" onclick="logout()">切换帐号</a></dd>
                  <dd><a style="cursor: pointer;" onclick="logout()">退出</a></dd>
                </dl> -->
            </li>
          <li class="layui-nav-item to-index"><a style="cursor: pointer;" onclick="logout()">退出</a></li>
        </ul>
        
    </div>
    <!-- 顶部结束 -->
    <!-- 中部开始 -->
    <!-- 左侧菜单开始 -->
    <div class="left-nav">
      <div id="side-nav">
        <ul id="nav">
            <?php if(is_array($menu) || $menu instanceof \think\Collection || $menu instanceof \think\Paginator): $i = 0; $__LIST__ = $menu;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo1): $mod = ($i % 2 );++$i;?>  
            <li>
                <a href="javascript:;">
                    <i class="iconfont1"><?php echo $vo1['iconCls']; ?></i>
                    <cite><?php echo $vo1['name']; ?></cite>
                    <i class="iconfont nav_right">&#xe697;</i>
                </a>
                <ul class="sub-menu">
                    <?php if(is_array($vo1['subMenu']) || $vo1['subMenu'] instanceof \think\Collection || $vo1['subMenu'] instanceof \think\Paginator): $i = 0; $__LIST__ = $vo1['subMenu'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo2): $mod = ($i % 2 );++$i;?>
                    <li>
                        <a _href="<?php echo $vo2['url']; ?>">
                            <i class="iconfont">&#xe6a7;</i>
                            <cite><?php echo $vo2['name']; ?></cite>
                        </a>
                    </li>
                    <?php endforeach; endif; else: echo "" ;endif; ?>
                </ul>
            </li>
            <?php endforeach; endif; else: echo "" ;endif; ?>
        </ul>
      </div>
    </div>
    <!-- <div class="x-slide_left"></div> -->
    <!-- 左侧菜单结束 -->
    <!-- 右侧主体开始 -->
    <div class="page-content">
        <div class="layui-tab tab" id="xbs_tab_id" lay-filter="xbs_tab" lay-allowclose="false">
          <ul class="layui-tab-title">
            <li>我的桌面</li>
          </ul>
          <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <iframe src='/index.php/crm/Index/welcome.html' frameborder="0" scrolling="yes" class="bg-iframe"></iframe>
            </div>
          </div>
        </div>
    </div>
    <div class="page-content-bg"></div>
    <!-- 右侧主体结束 -->
    <!-- 中部结束 -->
    <!-- 底部开始 -->
    <div class="footer">
        <div class="copyright">Copyright ©2017 bangian.com v1.0 All Rights Reserved</div>  
    </div>
    <!-- 底部结束 -->
</body>
<div class="bg-body" id="id_setting" style="display:none;">
	<form class="layui-form" action="#" method="post" id="mainForm">
	  <div class="layui-form-item">
		<div class="layui-inline">
              <label class="layui-form-label"><span class="bg-red">*&nbsp;&nbsp;</span>密码：</label>
              <div class="layui-input-inline">
                <input type="password" name="password" id="password_id" required="" lay-verify="password" placeholder="" autocomplete="off" class="layui-input">
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label"><span class="bg-red">*&nbsp;&nbsp;</span>确认密码：</label>
              <div class="layui-input-inline">
                <input type="password" name="" id="repassword_id" required="" lay-verify="repassword" autocomplete="off" class="layui-input">
              </div>
            </div>
	  </div>
	  <div class="layui-form-item">
		  <label for="L_repass" class="layui-form-label">
		  </label>
		  <a  class="layui-btn" lay-filter="add"  id="save" lay-submit="">
                  提交并重新登录
          </a>
	  </div>
  </form>
</div>
<div class="bg-body" id="id_transfer" style="display:none;">
	<form class="layui-form" action="#" method="post" id="transferForm">
		<div class="layui-form-item layui-form-text">
			<div class="layui-inline">
			<label for="desc" class="layui-form-label">
				转接号码：
			</label>
			<div class="layui-input-inline">
				<input type="text" id="extension_num_id" style="width:220px;" class="layui-input">
			</div>
			<a class="layui-btn" onclick="transfer()">转接</a>
			</div>
		</div>
  </form>
</div>

<div class="bg-body" id="id_quickdial" style="display:none;">
	<form class="layui-form" action="#" method="post" id="quickdialForm">
		<div class="layui-form-item layui-form-text">
			<div class="layui-inline">
			<label for="desc" class="layui-form-label">
				拨打号码：
			</label>
			<div class="layui-input-inline">
				<input type="text" id="quickdial_num_id" style="width:220px;" class="layui-input">
			</div>
			<a class="layui-btn" onclick="quickdial()">拨号</a>
			</div>
		</div>
  </form>
</div>

<div class="bg-body" id="id_threePhone" style="display:none;">
	<form class="layui-form" action="#" method="post" id="threeCallForm">
		<div class="layui-form-item layui-form-text">
			<div class="layui-inline">
			<label for="desc" class="layui-form-label">
				接通号码：
			</label>
			<div class="layui-input-inline">
				<input type="text" id="id_three_phone" style="width:220px;" class="layui-input">
			</div>
			<a class="layui-btn" onclick="threeCall()">三方通话</a>
			</div>
		</div>
  </form>
</div>
<script type="text/javascript" src="/public/static/crm/js/index/index.js"></script>
<script>
	layui.use('layer', function(){ //独立版的layer无需执行这一句
		var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
        // alert("<?php echo $user_info['password']; ?>")
        
        //f9fc7199e30f7850b7b9e5ff4c7123f7     'aj123456'
        //d41d8cd98f00b204e9800998ecf8427e     ''
		if("<?php echo $user_info['password']; ?>"=="d41d8cd98f00b204e9800998ecf8427e"){
			layer.open({
			  type: 1
			  ,title: '首次登陆设置密码' //不显示标题栏
			  ,closeBtn: false
			  ,area: '500px;'
			  ,shade: 0.8
			  ,id: 'LAY_layuipro' //设定一个id，防止重复弹出
			  ,content: $('#id_setting') //这里content是一个DOM，注意：最好该元素要存放在body最外层，否则可能被其它的相对元素所影响
			});
		}else{
            var content = '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 500;font-size:18px;">你好呀！亲！<br><br><br>今日目标：'+"<?php echo $_SESSION['target']['daily']; ?>"+'<br><br>本月目标：'+"<?php echo $_SESSION['target']['monthly']; ?>"+'<br><br>本月完成：'+"<?php echo $_SESSION['target']['adopt_money']; ?>"+'<br><br>目标进度：'+"<?php echo $_SESSION['target']['complete']; ?>"+'<br><br><span style="float:right;font-weight: 500;font-size:18px;">加油！！！</span></div>';
			//示范一个公告层
			layer.open({
				type: 1
				,title: false //不显示标题栏
				,closeBtn: false
				,area: '300px;'
				,shade: 0.8
				,id: 'LAY_layuipro' //设定一个id，防止重复弹出
				,btn: ['知道了']
				,btnAlign: 'c'
				,moveType: 1 //拖拽模式，0或者1
				,content: content
				,success: function(layero){
				  var btn = layero.find('.layui-layer-btn');
				  btn.find('.layui-layer-btn0').attr({
					
				  });
				}
			})
		}
		
	})

	
	layui.use('form', function(){
	   var form = layui.form;
	  
	  //各种基于事件的操作，下面会有进一步介绍
	   form.verify({
		//数组的两个值分别代表：[正则匹配、匹配不符时的提示文字]
		password: [
		  /^[\S][A-Za-z0-9]{5,16}$/
		  ,'密码必须6到16位数字加字母，且不能出现空格'
		]
		,repassword: function(value){
			if($('#password_id').val()!=$('#repassword_id').val()){
				return '两次密码不一致';
			}
		} 
	  }); 

	  var ajax_option={  
		url:"settingPassword?username=<?php echo $user_info['username']; ?>",  
		success:function(data){  
		  var result = $.parseJSON(data); 
		  if (result) {  
			location.replace(location.href);
		  } else {  
			layer.alert(result.msg, {icon: 5}, function(index){
			  layer.close(index);
			}); 
		  }  
		}  
	  };  

	  form.on('submit(add)', function(data){
		$('#mainForm').ajaxSubmit(ajax_option);  
		return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
	  });  
	});
	
	function openTransfer(){
		layui.use('layer', function(){ //独立版的layer无需执行这一句
			var $ = layui.jquery, layer = layui.layer; 
			layer.open({
			  type: 1
			  ,title: '转接' //不显示标题栏
			  ,closeBtn: 1
			  ,area: '500px;'
			  ,shade: 0.4
			  ,id: 'LAY_layuitransfer' //设定一个id，防止重复弹出
			  ,content: $('#id_transfer') //这里content是一个DOM，注意：最好该元素要存放在body最外层，否则可能被其它的相对元素所影响
			});
		})
	}
	
	
	function openQuickdial(){
		layui.use('layer', function(){ //独立版的layer无需执行这一句
			var $ = layui.jquery, layer = layui.layer; 
			layer.open({
			  type: 1
			  ,title: '拨号' //不显示标题栏
			  ,closeBtn: 1
			  ,area: '500px;'
			  ,shade: 0.4
			  ,id: 'LAY_layuiquickdial' //设定一个id，防止重复弹出
			  ,content: $('#id_quickdial') //这里content是一个DOM，注意：最好该元素要存放在body最外层，否则可能被其它的相对元素所影响
			});
		})
	}
	
	function openThreeCall(){
		layui.use('layer', function(){ //独立版的layer无需执行这一句
			var $ = layui.jquery, layer = layui.layer; 
			layer.open({
			  type: 1
			  ,title: '三方通话' //不显示标题栏
			  ,closeBtn: 1
			  ,area: '500px;'
			  ,shade: 0.4
			  ,id: 'LAY_layuithreePhone' //设定一个id，防止重复弹出
			  ,content: $('#id_threePhone') //这里content是一个DOM，注意：最好该元素要存放在body最外层，否则可能被其它的相对元素所影响
			});
		})
	}
	
	</script>
</html>